home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / tran02 / tran.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  1.9 KB  |  76 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Translate"
  5.    ClientHeight    =   1800
  6.    ClientLeft      =   2505
  7.    ClientTop       =   1890
  8.    ClientWidth     =   4335
  9.    Height          =   2205
  10.    Icon            =   TRAN.FRX:0000
  11.    Left            =   2445
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   1800
  16.    ScaleWidth      =   4335
  17.    Top             =   1545
  18.    Width           =   4455
  19.    Begin OptionButton Option2 
  20.       Caption         =   "Hex"
  21.       Height          =   252
  22.       Left            =   360
  23.       TabIndex        =   3
  24.       Top             =   1200
  25.       Width           =   612
  26.    End
  27.    Begin CommandButton Command1 
  28.       Caption         =   "Translate"
  29.       Default         =   -1  'True
  30.       Height          =   372
  31.       Left            =   1560
  32.       TabIndex        =   1
  33.       Top             =   1080
  34.       Width           =   1092
  35.    End
  36.    Begin OptionButton Option1 
  37.       Caption         =   "Decimal"
  38.       Height          =   252
  39.       Left            =   360
  40.       TabIndex        =   2
  41.       Top             =   840
  42.       Width           =   972
  43.    End
  44.    Begin TextBox Text1 
  45.       Height          =   372
  46.       Left            =   360
  47.       TabIndex        =   0
  48.       Top             =   240
  49.       Width           =   3612
  50.    End
  51. Dim hexout As Integer
  52. Sub Command1_Click ()
  53.  length% = Len(text1.text)
  54.  For x% = 1 To length%
  55.   If hexout% Then
  56.    msg$ = msg$ + " " + Hex$(Asc(text1.text))
  57.   Else
  58.    msg$ = msg$ + " " + Str$(Asc(text1.text))
  59.   End If
  60.   text1.text = Right$(text1.text, length% - x%)
  61.  Next x%
  62.  MsgBox msg$
  63.  form1.text1.SetFocus
  64. End Sub
  65. Sub Form_Load ()
  66.  option1.value = -1
  67. End Sub
  68. Sub Option1_Click ()
  69.  hexout% = 0
  70. End Sub
  71. Sub Option1_GotFocus ()
  72. End Sub
  73. Sub Option2_Click ()
  74.  hexout% = -1
  75. End Sub
  76.